package org.tc.feign.product.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.tc.feign.service.FeignPicturesService;
import org.tc.product.entity.Pictures;

import java.util.List;

@CrossOrigin(origins = {"http://localhost:8080"}, methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.OPTIONS}, allowCredentials = "true")
@RestController
public class PicturesController {
    

    @Autowired
    private FeignPicturesService feignPicturesService;

    @RequestMapping("/insertPicd")
    public int insertPic(@RequestBody Pictures pictures) {
        int count = feignPicturesService.insertPic(pictures);
        return count;
    }

    @RequestMapping("/getPic")
    public List<Pictures> getPic(@RequestBody Pictures pictures) {
        List<Pictures> pic = feignPicturesService.getPic(pictures);
        return pic;
    }

    @RequestMapping("/updPicById")
    public int updPic(@RequestBody Pictures record) {
        int count = feignPicturesService.updPic(record);
        return count;
    }
}
